---
category: Array
created: '2020-04-19'
title: Find the maximum item of an array
updated: '2021-10-13'
---

**JavaScript version**

```js max.js
const max = (arr) => Math.max(...arr);
```

**TypeScript version**

```ts max.ts
const max = (arr: number[]): number => Math.max(...arr);
```
